Skip to content

Conversation

@ajkyffin
Copy link

@ajkyffin ajkyffin commented Feb 9, 2024

Prevents pipelines from being paused when preparing for shutdown. No new parts of pipelines are scheduled to executors but parts already running can run to completion, allowing Jenkins to be restarted without any running jobs.

This is disabled by default and enabled by setting -Dorg.jenkinsci.plugins.workflow.cps.CpsThreadGroup.keepPipelinesRunningWhenQuietingDown=true.

This provides a solution for https://issues.jenkins.io/browse/JENKINS-60434.

Testing done

The default case is covered by existing tests in CpsFlowExecutionTest.java.

For the case with -Dorg.jenkinsci.plugins.workflow.cps.CpsThreadGroup.keepPipelinesRunningWhenQuietingDown=true:

  • tested that pipelines are not automatically pause when preparing for shutdown
  • tested manually pausing and resuming a pipeline
  • tested manually pausing and resuming a pipeline while preparing for shutdown
  • tested preparing for shutdown, allowing a pipeline to run to the end of it's current node section, and restarting Jenkins. The pipeline resumed at the next node section as expected.
### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [ ] Link to relevant pull requests, esp. upstream and downstream changes
- [ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue

@ajkyffin ajkyffin requested a review from a team as a code owner February 9, 2024 16:58
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely functionally incomplete, deserves some test coverage, and ought to be an explicit option at the GUI (or CLI etc.) level rather than a system property. See discussion in Jira.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants